<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <a>二班成绩</a>
    <ul>
        <li class="score">90</li>
        <li class="score">95</li>
        <li class="score">100</li>
        <li class="score">60</li>
        <li class="score">65</li>
        <li class="score">70</li>
        <li class="score">75</li>
        <li class="score">80</li>
        <li class="score">85</li>
    </ul>
    <button value="最低分" onclick="minC()">最低分</button><br/>
    <button value="最高分" onclick="maxC()">最高分</button>

    <script>
        var i = document.getElementsByClassName("score");
        var btn = document.querySelectorAll("button")
        var a =i[0].innerHTML;

        function sel(){
            if(btn.innerHTML == "最低分"){
                Array.prototype.forEach.call(i,function(item,index){
                if(Number(item.innerHTML)<Number(a)){
                    a = item.innerHTML;
                }
            })
            alert("最低分为"+a)
            }else{
                Array.prototype.forEach.call(i,function(item,index){
                if(Number(item.innerHTML)>Number(a)){
                    a = item.innerHTML;
                }
            })
            alert("最高分为"+a)
            }
        }

        function minC(){
            Array.prototype.forEach.call(i,function(item,index){
                if(Number(item.innerHTML)<Number(a)){
                    a = item.innerHTML;
                }
            })
            alert("最低分为"+a)
        }
        function maxC(){
            Array.prototype.forEach.call(i,function(item,index){
                if(Number(item.innerHTML)>Number(a)){
                    a = item.innerHTML;
                }
            })
            alert("最高分为"+a)
        }

    </script>
</body>
</html>